import { computed, defineComponent, PropType, ref, watch } from "vue";
import SideBarLinks from "./SideBarLinks.vue";
import { useinnerhehight } from "./useinnerhehight";
export default defineComponent({
    components: { SideBarLinks },
    setup(props) {
        // console.log(props);
        const innerheight = useinnerhehight();

        const sidebar = ref<HTMLElement>();

        watch(
            () => sidebar.value,
            (value) => props.innerref(value)
        );
        const maxheight = computed(() => {
            return String(innerheight.value - props.top) + "px";
        });
        return { sidebar, innerheight, maxheight };
    },

    props: {
        // html: { type: String, required: false },
        top: { type: Number, required: true },
        innerref: {
            type: Function as PropType<(a: HTMLElement | undefined) => void>,
            required: true,
        },
    },
});
